package com.admgt.resource.ui;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import com.admgt.resource.dao.LoadingInfoDao;
import com.admgt.resource.service.ResourceService;
import com.admgt.resource.service.ResourceServiceImpl;

@ContextConfiguration({"/app-config.xml"})
public class Main {
	private  LoadingInfoDao dao;
	@Autowired
	public void setDao(LoadingInfoDao dao) {
		this.dao = dao;
	}
	
	public LoadingInfoDao getDao() {
		return dao;
	}

	public static void main(String[] args) {
		ResourceService resourceService = new ResourceServiceImpl();
		resourceService.setLoadingInfoDao(new Main().getDao());
		ResourceFrame resourceFrame = new ResourceFrame();
		ResourceContext resourceContext = new ResourceContext();
		resourceContext.setResourceFrame(resourceFrame);
		resourceContext.setResourceService(resourceService);
		resourceFrame.setResourceContext(resourceContext);
		resourceContext.show();
	}

}
